package com.yyj.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yyj.dao.PutDao;
import com.yyj.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PutService {
    @Autowired
    PutDao putDao;

    public PageInfo<Pet> getBySearch(PetParams petParams) {
        //开启分页查询
        PageHelper.startPage(petParams.getPageNum(), petParams.getPageSize());
        //裸数据 不包括数据总数,当前页和页面大小
        List<Pet> list = putDao.getBySearch(petParams);
        //封装在一起的数据
        return PageInfo.of(list);
    }

    public List<Pet> getMyPut(Integer originalOwnerId) {
        List<Pet> myPut = putDao.getMyPut(originalOwnerId);


        return myPut;
    }


}